<!doctype html>
<html lang="en">
<head>
    <title>Code coverage report for javascripts/dashboard/Dashboard.jsx</title>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="../../prettify.css" />
    <link rel="stylesheet" href="../../base.css" />
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <style type='text/css'>
        .coverage-summary .sorter {
            background-image: url(../../sort-arrow-sprite.png);
        }
    </style>
</head>
<body>
<div class='wrapper'>
  <div class='pad1'>
    <h1>
      <a href="../../index.html">All files</a> / <a href="index.html">javascripts/dashboard</a> Dashboard.jsx
    </h1>
    <div class='clearfix'>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Statements</span>
        <span class='fraction'>0/178</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Branches</span>
        <span class='fraction'>0/69</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Functions</span>
        <span class='fraction'>0/53</span>
      </div>
      <div class='fl pad1y space-right2'>
        <span class="strong">0% </span>
        <span class="quiet">Lines</span>
        <span class='fraction'>0/172</span>
      </div>
    </div>
  </div>
  <div class='status-line low'></div>
<pre><table class="coverage">
<tr><td class="line-count quiet">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348</td><td class="line-coverage quiet"><span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-no">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span>
<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">c</span>onst $ = <span class="cstat-no" title="statement not covered" >window.$ = require('jquery');
c</span>onst jQuery = <span class="cstat-no" title="statement not covered" >window.jQuery = require('jquery'); // eslint-disable-line
c</span>onst px = <span class="cstat-no" title="statement not covered" >require('../modules/superset');
c</span>onst d3 = <span class="cstat-no" title="statement not covered" >require('d3');
c</span>onst urlLib = <span class="cstat-no" title="statement not covered" >require('url');
c</span>onst utils = <span class="cstat-no" title="statement not covered" >require('../modules/utils');
const { Alert } = require('react-bootstrap');
&nbsp;
<span class="cstat-no" title="statement not covered" >import React from 'react';</span>
<span class="cstat-no" title="statement not covered" >import { render } from 'react-dom';</span>
<span class="cstat-no" title="statement not covered" >import GridLayout from './components/GridLayout';</span>
<span class="cstat-no" title="statement not covered" >import Header from './components/Header';</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >require('bootstrap');</span>
<span class="cstat-no" title="statement not covered" >require('../../stylesheets/dashboard.css');</span>
&nbsp;
export f</span>unction <span class="fstat-no" title="function not covered" >getInitialState(dashboardData, context) {
  c</span>onst dashboard = <span class="cstat-no" title="statement not covered" >Object.assign({ context }, utils.controllerInterface, dashboardData);
<span class="cstat-no" title="statement not covered" >  dashboard.firstLoad = true;</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >  dashboard.posDict = {};</span>
<span class="cstat-no" title="statement not covered" >  if (dashboard.position_json) {</span>
<span class="cstat-no" title="statement not covered" >    dashboard.position_json.forEach(<span class="fstat-no" title="function not covered" >position =&gt; </span>{</span>
<span class="cstat-no" title="statement not covered" >      dashboard.posDict[position.slice_id] = position;</span>
    });
  }
<span class="cstat-no" title="statement not covered" >  dashboard.curUserId = dashboard.context.user_id;</span>
<span class="cstat-no" title="statement not covered" >  dashboard.refreshTimer = null;</span>
&nbsp;
  c</span>onst state = <span class="cstat-no" title="statement not covered" >{
    dashboard,
  };
<span class="cstat-no" title="statement not covered" >  return state;</span>
}
&nbsp;
f</span>unction <span class="fstat-no" title="function not covered" >unload() {
  c</span>onst message = <span class="cstat-no" title="statement not covered" >'You have unsaved changes.';
<span class="cstat-no" title="statement not covered" >  window.event.returnValue = message; // Gecko + IE</span>
<span class="cstat-no" title="statement not covered" >  return message; // Gecko + Webkit, Safari, Chrome etc.</span>
}
&nbsp;
f</span>unction <span class="fstat-no" title="function not covered" >onBeforeUnload(hasChanged) {
<span class="cstat-no" title="statement not covered" >  if (hasChanged) {</span>
<span class="cstat-no" title="statement not covered" >    window.addEventListener('beforeunload', unload);</span>
  } else {
<span class="cstat-no" title="statement not covered" >    window.removeEventListener('beforeunload', unload);</span>
  }
}
&nbsp;
f</span>unction <span class="fstat-no" title="function not covered" >renderAlert() {
<span class="cstat-no" title="statement not covered" >  render(</span>
    &lt;div className="container-fluid"&gt;
      &lt;Alert bsStyle="warning"&gt;
        &lt;strong&gt;You have unsaved changes.&lt;/strong&gt; Click the&amp;nbsp;
        &lt;i className="fa fa-save" /&gt;&amp;nbsp;
        button on the top right to save your changes.
      &lt;/Alert&gt;
    &lt;/div&gt;,
    document.getElementById('alert-container')
  );
}
&nbsp;
f</span>unction <span class="fstat-no" title="function not covered" >initDashboardView(dashboard) {
<span class="cstat-no" title="statement not covered" >  render(</span>
    &lt;Header dashboard={dashboard} /&gt;,
    document.getElementById('dashboard-header')
  );
  // eslint-disable-next-line no-param-reassign
<span class="cstat-no" title="statement not covered" >  dashboard.reactGridLayout = render(</span>
    &lt;GridLayout dashboard={dashboard} /&gt;,
    document.getElementById('grid-container')
  );
&nbsp;
  // Displaying widget controls on hover
<span class="cstat-no" title="statement not covered" >  $('.react-grid-item').hover(</span>
<span class="fstat-no" title="function not covered" >    function () </span>{
<span class="cstat-no" title="statement not covered" >      $(this).find('.chart-controls').fadeIn(300);</span>
    },
<span class="fstat-no" title="function not covered" >    function () </span>{
<span class="cstat-no" title="statement not covered" >      $(this).find('.chart-controls').fadeOut(300);</span>
    }
  );
<span class="cstat-no" title="statement not covered" >  $('div.grid-container').css('visibility', 'visible');</span>
&nbsp;
<span class="cstat-no" title="statement not covered" >  $('div.widget').click(<span class="fstat-no" title="function not covered" >function (</span>e) {</span>
    c</span>onst $this = <span class="cstat-no" title="statement not covered" >$(this);
    c</span>onst $target = <span class="cstat-no" title="statement not covered" >$(e.target);
&nbsp;
<span class="cstat-no" title="statement not covered" >    if ($target.hasClass('slice_info')) {</span>
<span class="cstat-no" title="statement not covered" >      $this.find('.slice_description').slideToggle(0, <span class="fstat-no" title="function not covered" >function () </span>{</span>
<span class="cstat-no" title="statement not covered" >        $this.find('.refresh').click();</span>
      });
    } else <span class="cstat-no" title="statement not covered" >if ($target.hasClass('controls-toggle')) {</span>
<span class="cstat-no" title="statement not covered" >      $this.find('.chart-controls').toggle();</span>
    }
  });
<span class="cstat-no" title="statement not covered" >  px.initFavStars();</span>
<span class="cstat-no" title="statement not covered" >  $('[data-toggle="tooltip"]').tooltip({ container: 'body' });</span>
}
&nbsp;
export f</span>unction <span class="fstat-no" title="function not covered" >dashboardContainer(dashboard) {
<span class="cstat-no" title="statement not covered" >  return Object.assign({}, dashboard, <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" >{</span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span></span>
    type: 'dashboard',
    filters: {},
    init() <span class="cstat-no" title="statement not covered" >{</span>
<span class="cstat-no" title="statement not covered" >      this.sliceObjects = [];</span>
<span class="cstat-no" title="statement not covered" >      dashboard.slices.forEach(<span class="fstat-no" title="function not covered" >(</span>data) =&gt; {</span>
<span class="cstat-no" title="statement not covered" >        if (data.error) {</span>
          c</span>onst html = <span class="cstat-no" title="statement not covered" >'&lt;div class="alert alert-danger"&gt;' + data.error + '&lt;/div&gt;';
<span class="cstat-no" title="statement not covered" >          $('#slice_' + data.slice_id).find('.token').html(html);</span>
        } else <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >{</span></span>
          c</span>onst slice = <span class="cstat-no" title="statement not covered" >px.Slice(data, this);
<span class="cstat-no" title="statement not covered" >          $('#slice_' + data.slice_id).find('a.refresh').click(<span class="fstat-no" title="function not covered" >() =&gt; </span>{</span>
<span class="cstat-no" title="statement not covered" >            slice.render(true);</span>
          });
<span class="cstat-no" title="statement not covered" >          this.sliceObjects.push(slice);</span>
        }
      });
<span class="cstat-no" title="statement not covered" >      this.loadPreSelectFilters();</span>
<span class="cstat-no" title="statement not covered" >      this.startPeriodicRender(0);</span>
<span class="cstat-no" title="statement not covered" >      this.bindResizeToWindowResize();</span>
    },
    onChange() {
<span class="cstat-no" title="statement not covered" >      onBeforeUnload(true);</span>
<span class="cstat-no" title="statement not covered" >      renderAlert();</span>
    },
    onSave() {
<span class="cstat-no" title="statement not covered" >      onBeforeUnload(false);</span>
<span class="cstat-no" title="statement not covered" >      $('#alert-container').html('');</span>
    },
    loadPreSelectFilters() {
<span class="cstat-no" title="statement not covered" >      try {</span>
        c</span>onst filters = <span class="cstat-no" title="statement not covered" >JSON.parse(px.getParam('preselect_filters') || '{}');
<span class="cstat-no" title="statement not covered" >        for (const sliceId in filters) {</span>
<span class="cstat-no" title="statement not covered" >          for (const col in filters[sliceId]) {</span>
<span class="cstat-no" title="statement not covered" >            this.setFilter(sliceId, col, filters[sliceId][col], false, false);</span>
          }
        }
      } catch (e) {
        // console.error(e);
      }
    },
    setFilter(sliceId, col, vals, refresh) {
<span class="cstat-no" title="statement not covered" >      this.addFilter(sliceId, col, vals, false, refresh);</span>
    },
    done(slice) {
      c</span>onst refresh = <span class="cstat-no" title="statement not covered" >slice.getWidgetHeader().find('.refresh');
      c</span>onst data = <span class="cstat-no" title="statement not covered" >slice.data;
<span class="cstat-no" title="statement not covered" >      if (data !== undefined &amp;&amp; data.is_cached) {</span>
<span class="cstat-no" title="statement not covered" >        refresh</span>
        .addClass('danger')
        .attr('title',
              'Served from data cached at ' + data.cached_dttm +
                '. Click to force refresh')
                .tooltip('fixTitle');
      } else {
<span class="cstat-no" title="statement not covered" >        refresh</span>
        .removeClass('danger')
        .attr('title', 'Click to force refresh')
        .tooltip('fixTitle');
      }
    },
    effectiveExtraFilters(sliceId) {
      c</span>onst f = <span class="cstat-no" title="statement not covered" >[];
      c</span>onst immuneSlices = <span class="cstat-no" title="statement not covered" >this.metadata.filter_immune_slices || [];
<span class="cstat-no" title="statement not covered" >      if (sliceId &amp;&amp; immuneSlices.includes(sliceId)) {</span>
        // The slice is immune to dashboard fiterls
<span class="cstat-no" title="statement not covered" >        return f;</span>
      }
&nbsp;
      // Building a list of fields the slice is immune to filters on
      l</span>et immuneToFields = <span class="cstat-no" title="statement not covered" >[];
<span class="cstat-no" title="statement not covered" >      if (</span>
            sliceId &amp;&amp;
            this.metadata.filter_immune_slice_fields &amp;&amp;
            this.metadata.filter_immune_slice_fields[sliceId]) {
<span class="cstat-no" title="statement not covered" >        immuneToFields = this.metadata.filter_immune_slice_fields[sliceId];</span>
      }
<span class="cstat-no" title="statement not covered" >      for (const filteringSliceId in this.filters) {</span>
<span class="cstat-no" title="statement not covered" >        for (const field in this.filters[filteringSliceId]) {</span>
<span class="cstat-no" title="statement not covered" >          if (!immuneToFields.includes(field)) {</span>
<span class="cstat-no" title="statement not covered" >            f.push({</span>
              col: field,
              op: 'in',
              val: this.filters[filteringSliceId][field],
            });
          }
        }
      }
<span class="cstat-no" title="statement not covered" >      return f;</span>
    },
    addFilter(sliceId, col, vals, merge = true, refresh = true) <span class="cstat-no" title="statement not covered" ></span>{
<span class="cstat-no" title="statement not covered" >      if (!(sliceId in this.filters)) {</span>
<span class="cstat-no" title="statement not covered" >        this.filters[sliceId] = {};</span>
      }
<span class="cstat-no" title="statement not covered" >      if (!(col in this.filters[sliceId]) || !merge) {</span>
<span class="cstat-no" title="statement not covered" >        this.filters[sliceId][col] = vals;</span>
      } else {
<span class="cstat-no" title="statement not covered" >        this.filters[sliceId][col] = d3.merge([this.filters[sliceId][col], vals]);</span>
      }
<span class="cstat-no" title="statement not covered" >      if (refresh) {</span>
<span class="cstat-no" title="statement not covered" >        this.refreshExcept(sliceId);</span>
      }
<span class="cstat-no" title="statement not covered" >      this.updateFilterParamsInUrl();</span>
    },
    readFilters() {
      // Returns a list of human readable active filters
<span class="cstat-no" title="statement not covered" >      return JSON.stringify(this.filters, null, '  ');</span>
    },
    updateFilterParamsInUrl() {
      c</span>onst urlObj = <span class="cstat-no" title="statement not covered" >urlLib.parse(location.href, true);
<span class="cstat-no" title="statement not covered" >      urlObj.query = urlObj.query || {};</span>
<span class="cstat-no" title="statement not covered" >      urlObj.query.preselect_filters = this.readFilters();</span>
<span class="cstat-no" title="statement not covered" >      urlObj.search = null;</span>
<span class="cstat-no" title="statement not covered" >      history.pushState(urlObj.query, window.title, urlLib.format(urlObj));</span>
    },
    bindResizeToWindowResize() {
      l</span>et <span class="cstat-no" title="statement not covered" >resizeTimer;
      c</span>onst dash = <span class="cstat-no" title="statement not covered" >this;
<span class="cstat-no" title="statement not covered" >      $(window).on('resize', <span class="fstat-no" title="function not covered" >() =&gt; </span>{</span>
<span class="cstat-no" title="statement not covered" >        clearTimeout(resizeTimer);</span>
<span class="cstat-no" title="statement not covered" >        resizeTimer = setTimeout(<span class="fstat-no" title="function not covered" >() =&gt; </span>{</span>
<span class="cstat-no" title="statement not covered" >          dash.sliceObjects.forEach(<span class="fstat-no" title="function not covered" >(</span>slice) =&gt; {</span>
<span class="cstat-no" title="statement not covered" >            slice.resize();</span>
          });
        }, 500);
      });
    },
    stopPeriodicRender() {
<span class="cstat-no" title="statement not covered" >      if (this.refreshTimer) {</span>
<span class="cstat-no" title="statement not covered" >        clearTimeout(this.refreshTimer);</span>
<span class="cstat-no" title="statement not covered" >        this.refreshTimer = null;</span>
      }
    },
    startPeriodicRender(interval) {
<span class="cstat-no" title="statement not covered" >      this.stopPeriodicRender();</span>
      c</span>onst dash = <span class="cstat-no" title="statement not covered" >this;
      c</span>onst maxRandomDelay = <span class="cstat-no" title="statement not covered" >Math.max(interval * 0.2, 5000);
      c</span>onst <span class="cstat-no" title="statement not covered" ><span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" >refreshAll = (</span>) =&gt; {</span></span>
<span class="cstat-no" title="statement not covered" >        dash.sliceObjects.forEach(<span class="fstat-no" title="function not covered" >slice =&gt; </span>{</span>
          c</span>onst force = <span class="cstat-no" title="statement not covered" >!dash.firstLoad;
<span class="cstat-no" title="statement not covered" >          setTimeout(<span class="fstat-no" title="function not covered" >() =&gt; </span>{</span>
<span class="cstat-no" title="statement not covered" >            slice.render(force);</span>
          },
          // Randomize to prevent all widgets refreshing at the same time
          maxRandomDelay * Math.random());
        });
<span class="cstat-no" title="statement not covered" >        dash.firstLoad = false;</span>
      };
&nbsp;
      c</span>onst <span class="cstat-no" title="statement not covered" ><span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" >fetchAndRender = f</span>unction () {</span></span>
<span class="cstat-no" title="statement not covered" >        refreshAll();</span>
<span class="cstat-no" title="statement not covered" >        if (interval &gt; 0) {</span>
<span class="cstat-no" title="statement not covered" >          dash.refreshTimer = setTimeout(<span class="fstat-no" title="function not covered" >function () </span>{</span>
<span class="cstat-no" title="statement not covered" >            fetchAndRender();</span>
          }, interval);
        }
      };
<span class="cstat-no" title="statement not covered" >      fetchAndRender();</span>
    },
    refreshExcept(sliceId) {
      c</span>onst immune = <span class="cstat-no" title="statement not covered" >this.metadata.filter_immune_slices || [];
<span class="cstat-no" title="statement not covered" >      this.sliceObjects.forEach(<span class="fstat-no" title="function not covered" >slice =&gt; </span>{</span>
<span class="cstat-no" title="statement not covered" >        if (slice.data.slice_id !== sliceId &amp;&amp; immune.indexOf(slice.data.slice_id) === -1) <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >{</span></span></span>
<span class="cstat-no" title="statement not covered" >          slice.render();</span>
          c</span>onst sliceSeletor = <span class="cstat-no" title="statement not covered" >$(`#${slice.data.slice_id}-cell`);
<span class="cstat-no" title="statement not covered" >          sliceSeletor.addClass('slice-cell-highlight');</span>
<span class="cstat-no" title="statement not covered" >          setTimeout(<span class="fstat-no" title="function not covered" >function () </span>{</span>
<span class="cstat-no" title="statement not covered" >            sliceSeletor.removeClass('slice-cell-highlight');</span>
          }, 1200);
        }
      });
    },
    clearFilters(sliceId) {
<span class="cstat-no" title="statement not covered" >      delete this.filters[sliceId];</span>
<span class="cstat-no" title="statement not covered" >      this.refreshExcept(sliceId);</span>
<span class="cstat-no" title="statement not covered" >      this.updateFilterParamsInUrl();</span>
    },
    removeFilter(sliceId, col, vals) <span class="cstat-no" title="statement not covered" >{</span>
<span class="cstat-no" title="statement not covered" >      if (sliceId in this.filters) {</span>
<span class="cstat-no" title="statement not covered" >        if (col in this.filters[sliceId]) <span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" >{</span></span></span>
          c</span>onst a = <span class="cstat-no" title="statement not covered" >[];
<span class="cstat-no" title="statement not covered" >          this.filters[sliceId][col].forEach(<span class="fstat-no" title="function not covered" >function (</span>v) {</span>
<span class="cstat-no" title="statement not covered" >            if (vals.indexOf(v) &lt; 0) {</span>
<span class="cstat-no" title="statement not covered" >              a.push(v);</span>
            }
          });
<span class="cstat-no" title="statement not covered" >          this.filters[sliceId][col] = a;</span>
        }
      }
<span class="cstat-no" title="statement not covered" >      this.refreshExcept(sliceId);</span>
<span class="cstat-no" title="statement not covered" >      this.updateFilterParamsInUrl();</span>
    },
    getSlice(sliceId) {
      c</span>onst id = <span class="cstat-no" title="statement not covered" >parseInt(sliceId, 10);
      l</span>et i = <span class="cstat-no" title="statement not covered" >0;
      l</span>et slice = <span class="cstat-no" title="statement not covered" >null;
<span class="cstat-no" title="statement not covered" >      while (i &lt; this.sliceObjects.length) {</span>
        // when the slice is found, assign to slice and break;
<span class="cstat-no" title="statement not covered" >        if (this.sliceObjects[i].data.slice_id === id) {</span>
<span class="cstat-no" title="statement not covered" >          slice = this.sliceObjects[i];</span>
<span class="cstat-no" title="statement not covered" >          break;</span>
        }
<span class="cstat-no" title="statement not covered" >        i++;</span>
      }
<span class="cstat-no" title="statement not covered" >      return slice;</span>
    },
    getAjaxErrorMsg(error) {
      c</span>onst respJSON = <span class="cstat-no" title="statement not covered" >error.responseJSON;
<span class="cstat-no" title="statement not covered" >      return (respJSON &amp;&amp; respJSON.message) ? respJSON.message :</span>
              error.responseText;
    },
    addSlicesToDashboard(sliceIds) {
      c</span>onst getAjaxErrorMsg = <span class="cstat-no" title="statement not covered" >this.getAjaxErrorMsg;
<span class="cstat-no" title="statement not covered" >      $.ajax(<span class="cstat-no" title="statement not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" ><span class="fstat-no" title="function not covered" >{</span></span></span></span></span>
        type: 'POST',
        url: `/superset/add_slices/${dashboard.id}/`,
        data: {
          data: JSON.stringify({ slice_ids: sliceIds }),
        },
        success() {
          // Refresh page to allow for slices to re-render
<span class="cstat-no" title="statement not covered" >          window.location.reload();</span>
        },
        error(error) {
          c</span>onst errorMsg = <span class="cstat-no" title="statement not covered" >getAjaxErrorMsg(error);
<span class="cstat-no" title="statement not covered" >          utils.showModal({</span>
            title: 'Error',
            body: 'Sorry, there was an error adding slices to this dashboard: &lt;/ br&gt;' + errorMsg,
          });
        },
      });
    },
  });
}
&nbsp;
<span class="cstat-no" title="statement not covered" >$(document).ready(<span class="fstat-no" title="function not covered" >() =&gt; </span>{</span>
  // Getting bootstrapped data from the DOM
<span class="cstat-no" title="statement not covered" >  utils.initJQueryAjaxCSRF();</span>
  c</span>onst dashboardData = <span class="cstat-no" title="statement not covered" >$('.dashboard').data('dashboard');
  c</span>onst contextData = <span class="cstat-no" title="statement not covered" >$('.dashboard').data('context');
&nbsp;
  c</span>onst state = <span class="cstat-no" title="statement not covered" >getInitialState(dashboardData, contextData);
  c</span>onst dashboard = <span class="cstat-no" title="statement not covered" >dashboardContainer(state.dashboard);
<span class="cstat-no" title="statement not covered" >  initDashboardView(dashboard);</span>
<span class="cstat-no" title="statement not covered" >  dashboard.init();</span>
});
&nbsp;</pre></td></tr>
</table></pre>
<div class='push'></div><!-- for sticky footer -->
</div><!-- /wrapper -->
<div class='footer quiet pad2 space-top1 center small'>
  Code coverage
  generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Tue Apr 11 2017 20:15:55 GMT-0700 (PDT)
</div>
</div>
<script src="../../prettify.js"></script>
<script>
window.onload = function () {
        if (typeof prettyPrint === 'function') {
            prettyPrint();
        }
};
</script>
<script src="../../sorter.js"></script>
</body>
</html>
